package com.yc.design.mode.factorymethod.simplefactory;

import com.yc.design.mode.factorymethod.Product;

public class SimpleConcreateFactory {
    public static <T extends Product> T createProduct(Class<T> c){
        Product product=null;
        try {
            product= (Product) Class.forName(c.getName()).newInstance();
        } catch (Exception e) {
            e.printStackTrace();
        }
        return (T) product;
    }
}
